package com.ganbo.pattern.flyweight;

public class MemoryPoolTest {

    public static void main(String[] args) {

        //首次获取内存，将创建一个内存
        Memory memmory = MemoryPool.getMemmory(32);

        //在使用过后释放内存
        MemoryPool.releaseMemory(memmory.getId());

        //重新获取内存，将从对象池缓存中获取
        memmory = MemoryPool.getMemmory(32);
    }
}
